package cn.piggy.gateway.interfaces;

import cn.piggy.gateway.sdk.annotation.ApiProducerClazz;
import cn.piggy.gateway.sdk.annotation.ApiProducerMethod;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.Map;


@Controller
@ApiProducerClazz(interfaceName = "HTTP-服务", interfaceVersion = "1.0.0")
public class TestController {

    @ResponseBody
    @RequestMapping("/wg/http/test1")
    @ApiProducerMethod(methodType = "HTTP", uri = "/wg/http/test1", httpCommandType = "GET", auth = 0)
    public Map<String,Object> fun1(@RequestBody Map<String,Object> map) {
        return map;
    }


    @ResponseBody
    @RequestMapping("/wg/http/test2")
    @ApiProducerMethod(methodType = "HTTP", uri = "/wg/http/test2", httpCommandType = "GET", auth = 0)
    public String fun2() {
        return "http";
    }

    @ResponseBody
    @RequestMapping("/wg/http/test3")
    @ApiProducerMethod(methodType = "HTTP", uri = "/wg/http/test3", httpCommandType = "POST", auth = 0)
    public Map<String,Object> fun3(@RequestBody Map<String,Object> map) {
        return map;
    }
}
